<template>
  <div id="box">
    <div class="search_box">
      <div class="search_input">
        <el-input v-model="value" />
        <el-select v-model="value" />
        <el-select v-model="value" />
      </div>
      <div class="search_btn">
        <el-button type="primary" icon="el-icon-search">搜索</el-button>
        <el-button icon="el-icon-refresh-right">重置</el-button>
      </div>
    </div>
    <el-button class="add_btn" type="primary" icon="el-icon-plus" @click="createAvtive = true">新建商品</el-button>
    <el-table :data="list" style="width: 100%" border :header-cell-style="()=>{return 'background-color:#f2f3f5'}" height="620">
      <template slot="empty">
        暂无数据~
      </template>
      <el-table-column prop="name" label="名称" />
      <el-table-column prop="name" label="名称" />
      <el-table-column prop="name" label="名称" />
      <el-table-column prop="name" label="名称" />
      <el-table-column prop="name" label="名称" />
      <el-table-column label="操作">
        <template slot-scope="">
          <el-button type="text" @click="createAvtive = true">修改</el-button>

          <el-popconfirm
            title="这是一段内容确定删除吗？"
          >
            <el-button slot="reference" type="text">删除</el-button>
          </el-popconfirm>
        </template>
      </el-table-column>
    </el-table>
    <div class="pagination">
      <el-pagination :page-size="100" layout="total, prev, pager, next,jumper" :total="1000" />
    </div>
    <el-dialog
      title="新建代理商"
      :visible.sync="createAvtive"
      width="30%"
      :before-close="handleClose"
    >
      <el-form>
        <el-form-item label="代理商名称">
          <el-input v-model="form.name" />
        </el-form-item>
        <el-form-item label="代理商等级">
          <el-select v-model="form.name" style="width: 100%;">
            <el-option label="一级" value="1" />
            <el-option label="二级" value="2" />
            <el-option label="三级" value="3" />
          </el-select>
        </el-form-item>
        <el-form-item label="所属上级">
          <el-select v-model="form.name" style="width: 100%;">
            <el-option label="商家" value="1" />
            <el-option label="代理1" value="2" />
            <el-option label="代理2" value="3" />
          </el-select>
        </el-form-item>
        <el-form-item label="分佣逻辑">
          <el-input v-model="form.name" />
        </el-form-item>
      </el-form>
      <span slot="footer" class="dialog-footer">
        <el-button @click="createAvtive = false">取 消</el-button>
        <el-button type="primary" @click="createAvtive = false">确 定</el-button>
      </span>
    </el-dialog>
  </div>
</template>
<script>
export default {
  data() {
    return {
      value: '',
      createAvtive: false,
      form: { name: '' },
      list: [
        { name: '代理商' },
        { name: '经销商' }
      ]
    }
  },
  created() {
  },
  methods: {
    handleClose() {
      this.handleClose = false
    }
  }
}
</script>
    <style lang='scss' scoped>

    .pagination {
        width: 100%;
        display: flex;
        justify-content: flex-end;
        margin-top: 20px;
    }
    </style>
